<template>
  <div class="pending-tip">
    <div v-if="tips" class="button-box">
      <div class="title">
        <span>{{ title }}</span>
        <span>{{ num }}</span> 个窍待处理！
      </div>

      <el-button type="primary" size="mini" @click="$emit('goToTemplist')"
        >去处理</el-button
      >
      <el-button
        class="close-button"
        size="mini"
        @click="$emit('close', !isClose)"
        >关闭</el-button
      >
    </div>

    <div v-else>
      <i class="el-icon-warning"></i>
      {{ title }}
    </div>
  </div>
</template>

<script>
export default {
  name: "PendingTips",
  props: {
    tips: {
      type: Boolean,
      default: true,
    },
    title: {
      type: String,
      default: "",
    },
    num: {
      type: Number,
      default: null,
    },
    isRecive: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      isClose: this.isRecive,
    };
  },
  watch: {
    isRecive() {
      this.isClose = this.isRecive;
    },
  },
};
</script>

<style lang="scss" scoped>
.pending-tip {
  color: #fa8022;
  // font-weight: bold;
  font-size: 16px;
  text-align: center;
  margin-bottom: 20px;
  margin-top: 10px;
  background-color: #fcf8e3;
  border: 1px solid #fbeed5;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  // padding: 10px 0;
  line-height: 52px;
  height: 52px;

  .button-box {
    display: flex;
    justify-content: center;
    align-items: center;
    .title {
      margin-right: 20px;
    }
    .close-button {
      color: #fa8022;
      border-color: #fa8022;
      background-color: #fcf8e3;
      margin-left: 20px;
    }
  }

  .el-icon-success {
    margin-right: 5px;
  }
}
</style>
